#ifndef __HAL_H
#define __HAL_H
#include "driver/gpio.h"
#include "driver/spi_master.h"
#include "esp_log.h"

#define PIN_NUM_MISO  13
#define PIN_NUM_MOSI  11
#define PIN_NUM_CLK   12

#define PUBLIC_SPI_HOST	SPI2_HOST
typedef struct
{
    #define u8_t    unsigned char
    u8_t   second;
	u8_t	minute;
	u8_t	hour;
	u8_t	week;
	u8_t	day;
	u8_t	month;
	u8_t	year;
}RTC_TIME;


void HAL_Init();

void Asw3410_Init();
void Asw3410_Set(int en);

int NandFlash_Init();
void NandFlash_deInit();


void RTC_Init();
void RTC_read_data(RTC_TIME* time);
void RTC_set_data(const RTC_TIME time);


void RJMU_Crypto_Init();
uint16_t OperationHandle(uint8_t *cmd, uint8_t *data, uint16_t d_len, uint8_t *result, uint16_t *r_len);

#endif